1. Field of the Invention
The present invention relates to a semiconductor disk device such as a semiconductor disk card that uses a flash memory as its storage medium.
2. Description of the Related Art
In the personal computer field, today, magnetic storage media such as hard disks are in widespread use to store relatively large amounts of data. Although the power consumption of hard disk drives are large, they offer excellent cost performance.
Semiconductor disk drive apparatuses have been introduced which drive a semiconductor memory such as a flash memory in a manner similar to the manner in which the hard disk drive apparatus drives a hard disk. Unlike the hard disk drive, the semiconductor disk drive contains no mechanical parts such as a motor. Although the semiconductor disk device is outperformed by the magnetic storage medium system in cost performance, the semiconductor disk device presents advantages in power consumption and reliability over the magnetic storage system. Thus, the demand for the semiconductor disk device is growing, in particular, in the portable information terminal field.
The flash memory has the following features. First, the flash memory is a non-volatile memory electronically programmable and erasable. Second, the flash memory accepts no data overwriting on a memory cell that is already programmed with data (thus, a programming operation is always associated with an erasing operation). Third, the unit of erasing ranges from a few bytes to tens of K bytes. Fourth, there is a limitation on program/erase cycles.
Referring to FIGS. 10 through 13, a prior art semiconductor disk device is discussed. FIGS. 10 through 13 show a known semiconductor disk device disclosed in Japanese Patent Laid-Open 5-27924. FIG. 10 is a block diagram showing generally the prior art semiconductor disk device. FIG. 11 shows the internal construction of an address conversion table of the device of FIG. 10. FIG. 12 shows the internal construction of the flash memory of the device of FIG. 10. FIG. 13 shows the internal construction of the block of the flash memory of FIG. 12.
As shown in FIG. 10, the prior art semiconductor disk device 2 comprises an interface circuit 3, CPU 4, an address conversion table 5, a flash control circuit 6, a data input/output sector buffer 7, and a flash memory 8. CPU 4 is constructed of MCU, ROM, RAM, I/O port and the like.
The host system 1 that is connected to the semiconductor disk device 2 is typically a notebook computer or a portable information terminal. Most of the semiconductor disk devices 2 are currently of a removable-card type. The interface circuit 3 performs information exchange with the host system 1. CPU 4 controls data input and output and issues instructions to the flash memory 8.
The logical sector/physical sector address conversion table 5 is a table that converts a logical sector address (LSA) into a physical sector address (PSA). LSA is a sector address the host system 1 specifies to the semiconductor disk device 2. PSA is an address in the flash memory 8 used in the semiconductor disk device 2.
The flash control circuit 6 performs simple data processing for the flash memory 8. For example, simple data exchange is accomplished by the flash control circuit 6, and the rest of the processing is accomplished by CPU 4. The data input/output sector buffer 7 is used to output data from the flash memory 8 through the interface circuit 3 or input data through the interface circuit 3 into the flash memory 8.
In FIG. 11, the address conversion table 5 is constructed of an LSA storage section and a PSA storage section.
The LSA storage section stores the logical sector addresses. Their contents are fixed. The PSA storage section stores arbitrary sector numbers (1 through n in FIG. 11) for the flash memory 8. The use of the address conversion table 5 allows data to be written on the physical sector addresses in a way convenient for internal data management, without the need for paying attention to the logical address specified by the host system 1. The address conversion table 5 is typically constructed of an SRAM, because it is frequently programmed and erased.
The capacity of the address conversion table 5 is determined as follows. Assuming that a flash memory 8 of 20 megabytes is used and that the unit of data for input and output (sector) is 512 bytes, the number of sectors in the semiconductor disk device 2 is calculated as follows: EQU Number of sectors in the semiconductor disk device 2=20 megabytes /512 bytes=40960 sectors
The number of bits required to express 40960 in binary is as follows: EQU ln 40960/ln 2=15.3
To express 40960, 16 bits are required.
The necessary capacity of the address conversion table 5 is 40960.times.16=655360 bits. In conclusion, the necessary capacity is 80 kilobytes.
In FIG. 12, the flash memory 8 is constructed of a plurality of blocks 9 and a plurality of backup blocks 9.
The flash memory 8 is a non-volatile memory electronically programmable and erasable. Because of its non-volatility, the flash memory 8 requires no backup battery, unlike DRAM and SRAM. Since the flash memory 8 has an electronically erasable capability, data modification is performed without detaching the flash memory 8 from its board, unlike EPROM. Since a single cell stores one bit data, the manufacturing cost required is lower than that for an EEPROM. These are advantages of the flash memory 8. Its disadvantages: the maximum erase cycles permitted is somewhere between 100000 and 1000000 times; each write operation must be associated with an erase operation (data overwriting onto a cell that has already stored data is not permitted); and erasing operation is performed by block and the block, namely, the unit of erasing ranges from a few kilobytes to tens of kilobytes.
As shown in FIG. 13, each block 9 has a block information memory area 10 on its header, a plurality of data memory areas 11 and a plurality of LSA memory areas 12.
The erase information memory area 10 stores the current block erase count. Each of the data memory areas 11 is typically 512 bytes (=one sector) large. Each sector is associated with an LSA memory area 12. When writing data, the LSA memory area 12 stores the LSA specified by the host system 1. If the logical sector/physical sector address conversion table 5 is made of an SRAM, data will be lost when power is cut off. When power is back on, the SRAM table 5 is reconstructed by searching all sectors in the LSA memory areas 12.
Referring to FIGS. 14, 15 and 16, the operation of the prior art semiconductor disk device is discussed. FIG. 14 is an explanatory diagram showing the read operation by the prior art semiconductor disk device. FIGS. 15 and 16 are explanatory diagrams showing the write operation by the prior art semiconductor disk device.
Unlike the hard disk system, the semiconductor disk device 2 employing the flash memory 8 is unable to overwrite data. Thus, the SRAM stores the address conversion table 5 that indicates the logical sector address of the data sent from the host system 1 and which physical sector address in the flash memory 8 is used for storage of the data. The use of the table 5 permits an efficient use of the memory areas of the flash memory 8.
Referring to FIG. 14, the data read operation of the semiconductor disk device 2 is discussed. The host system 1 sends to the semiconductor disk device 2 the sector address of the data to be read. The address data sent from the host system 1 is arranged in two kinds of format: LSA and CHS. The LSA format specifies each sector by a serial number from 1 through n. The CHS format specifies each data area by a combination of three data, namely, of a cylinder, a head and a sector used in the hard disk system. The semiconductor disk device 2 employs the LSA/PSA address conversion table 5. When the host system 1 sends the CHS formatted data, the interface circuit 3 converts it into LSA formatted data before next processing step.
CPU 4 address converts the LSA specified by the host system 1 into the PSA, referring to the address conversion table 5. Finally, the data corresponding to the PSA is read from the flash memory 8.
When the LSA specified by the host system 1 is 2, for example, the address conversion table 5 converts it into a PSA of 6. Accordingly, the data, A, is read. The LSA memory area 12 of the PSA, 6, stores 2 as its LSA.
The write operation of the semiconductor disk device 2 is discussed referring to FIGS. 15 and 16. Suppose that data, A, B, and C are stored, respectively, in PSAs 1, 3, and 7 in the initial condition of the device. It should be noted that the flash memory 8 permits no data overwriting in its write operation. In the above initial condition, PSAs 1, 3 and 7 are prohibited from overwriting.
When the host system 1 specifies an LSA with no data written, CPU 4 writes data on any appropriate empty area (PSAs 2, 4 through 6, and 8 through 12), and updates the data in the address conversion table 5. FIG. 15 shows that the host system 1 instructs the writing of data D onto the LSA 4. Data D and the LSA specified by the host system 1 are written on the PSA 4, and the PSA, 4, is written on the address corresponding to the LSA 4 in the address conversion table 5.
When the host system 1 instructs the writing onto the area having data (for example, writing is attempted under the same file name already existing), the data to be written is written onto an empty area in the flash memory 8, and the address conversion table 5 is updated. FIG. 16 shows the result of the writing of LSA 2. Update data B' is written onto the empty PSA 5, and the PSA area corresponding to the LSA 2 in the address conversion table 5 is changed to 5. The CPU 4 in the card should know that the PSA 3 is the data already used.
In the above described semiconductor disk device, the address conversion table 5 needs the memory area for storing a single PSA on the basis of a sector (the unit of data for data management). As the capacity of the flash memory 8 increases, the capacity of the address conversion table 5 must be increased accordingly.